
package com.naza.rpc.netty.handler;

import com.naza.rpc.netty.RpcSendHandler;
import com.naza.rpc.serialize.protostuff.ProtostuffCodecUtil;
import com.naza.rpc.serialize.protostuff.ProtostuffDecoder;
import com.naza.rpc.serialize.protostuff.ProtostuffEncoder;
import io.netty.channel.ChannelPipeline;

/**
 * RPC客户端 Protostuff 编解码 处理(RpcSendHandler)
 * 
 * @author yl
 */
public class ProtostuffSendHandler implements NazaSendHandler {
    @Override
    public void handle(ChannelPipeline pipeline) {
        ProtostuffCodecUtil util = new ProtostuffCodecUtil();
        util.setRpcDirect(false);
        pipeline.addLast(new ProtostuffEncoder(util));
        pipeline.addLast(new ProtostuffDecoder(util));
        pipeline.addLast(new RpcSendHandler());
    }
}
